<template>
	<div class="bottomNav">
		<div class="title">美团导航</div>
		<dl class="content">
			<dt class="subTitle">热门区域</dt>
			<div class="subList">
				<dd class="listItem" v-for="(item, index) in hotCityList" :key="index">
					<a href="" :title="item.name">{{ item.name }}</a>
				</dd>
			</div>
		</dl>
		<dl class="content">
			<dt class="subTitle">美食分类</dt>
			<div class="subList">
				<dd class="listItem" v-for="(item, index) in hotFoodList" :key="index">
					<a href="" :title="item.name">{{ item.name }}</a>
				</dd>
			</div>
		</dl>
	</div>
</template>

<script>
import { defineComponent, onMounted } from "vue";
export default defineComponent({
	name: "BottomNav",
});
</script>

<script setup>
import { ref } from "vue";
import { hotCityListApi, hotFoodListApi } from "@/api/home";
const hotCityList = ref([]);
const hotFoodList = ref([]);
onMounted(async () => {
	// 用于请求底部热门区域列表
	const res = await hotCityListApi();
	// console.log(res);
	hotCityList.value = res;

	// 用于请求底部美食列表
	const res2 = await hotFoodListApi();
	// console.log(res2);
	hotFoodList.value = res2;
});
</script>

<style scoped>
.bottomNav {
	width: 1200px;
	height: 230px;
	border: 1px solid #e5e5e5;
	margin-top: 50px;
}
.bottomNav .title {
	width: 100%;
	height: 50px;
	line-height: 50px;
	padding-top: 6px;
	padding-left: 20px;
	font-size: 16px;
	color: #222;
}

.content .subTitle {
	width: 100px;
	height: 100%;
	float: left;
	font-size: 14px;
	font-weight: 500;
	color: #222222;
	text-align: center;
	padding: 10px 0;
}
.content .subList {
	width: 1090px;
	height: auto;
	padding-top: 12px;
	float: left;
	border-bottom: 1px solid #e5e5e5;
	margin-bottom: 20px;
	overflow: hidden;
}
.content .subList .listItem {
	width: 100px;
	height: 17px;
	font-size: 12px;
	text-align: left;
	margin-bottom: 13px;
	float: left;
}
.content .subList .listItem a {
	display: block;
	width: 80px;
	cursor: pointer;
	color: #666666;
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}
</style>
